package cn.sppxpp.util;

import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

/**
 * @author spp
 * @date 2020-10-27 11:05
 * 配置文件工具类
 **/
public class PropertiesConfUtil {

    private Properties properties;

    public Properties propertiesConf(String confFile) throws IOException {
        //获取根路径
        String rootPath = PropertiesConfUtil.class.getResource("/").getPath();
        File file = new File(rootPath + confFile);
        properties = new Properties();
        FileReader reader = new FileReader(file);
        properties.load(reader);
        LogUtil.log("读取到配置文件" + file.getName());
        return properties;
    }

}
